<div >
    <div class="header-text">
        <h2 style="float: left;text-transform:uppercase"><?php echo Yii::t('lang','pick_seat'); ?></h2>
    </div>
    <div class="clear"></div>
    <p class="line"></p>
    <div class="clear"></div>
    <div class=" nice-scroll">
        <div class="col-sm-12">
            <div class="col-sm-6">
                <?php if (isset($_GET['ticket_id'])) : ?>
                <table class="table table-booked">
                    <thead>
                        <tr>
                          <th><?php echo Yii::t('lang','ticket_name') ?></th>
                          <th><?php echo Yii::t('lang','position') ?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach($_GET['ticket_id'] as $key => $value) : ?>
                        <tr>
                            <?php ?>
                            <?php $ticket = Ticket::model()->findByPk($value); ?>
                            <?php

                            $result = MyFunctionCustom::remain_quantity(null, $ticket['temp_quantity'], $ticket['remain_quantity']);
                            if ($result > 0) {
                                $result = true;
                            } else $result = false;
                            ?>
                            <?php if($result == true) { ?>
                                <td class="price-popup"><?php echo $ticket->description_of_ticket; ?></td>
                                <td><input class="text-seat" type="text" name="Ticket[seat][<?php echo $ticket->id; ?>]" /></td>
                            <?php } ?>
                        </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
                <?php endif;?>
            </div>
            <div class="col-sm-6">
                <div class="pull_right">
                    <ul class="text-ticket">
                        <?php $text_ticket = Translate::model()->findByPk($_GET['event']); ?>
                        <?php if($text_ticket->text_ticket != null){ ?>
                        <li>

                            <p style="color:#fc8825"><?php echo $text_ticket['text_ticket']; ?></p>
                        </li>
                        <? }?>
                        <br />
                        <li>
                            <p style="line-height:20px !important;">
                                <?php echo Yii::t('lang','text_seat'); ?>
                                <p style="line-height:20px !important;">
                                    <?php echo Yii::t('lang','example');?>
                                </p>
                            </p>


                        </li>
                    </ul>

                </div>
                <div class="continue-book wiget_footer">
                    <a class="book seat-map close-seatmap btn-continue">
                        <?php echo Yii::t('lang','seat_continue'); ?>
                    </a>
                </div>
            </div>
        </div>
    
    <div class="clear"></div>
    
    
    <div class="img-seat">
        <img src="<?php if(isset($_GET['pic'])) echo Yii::app()->baseUrl . '/timthumb.php?src=' . Yii::app()->baseUrl . '/data/pic/' .$_GET['pic'] . '&w=750' ; ?>" >
    </div>
    </div>
</div>
<script type="text/javascript">
    var seat = [];
$('.close-seatmap').click(function(){
                // var text;

                $('.text-seat').each(function(i){
                     text = $(this).val();
                    seat[$(this).attr('name')] = text;
//                     seat[i] = text.split(',');
                     console.log(seat);
                });
                
                $('#Modalseatmap').modal('hide');
                return false;
            });
$(document).one('ajaxComplete', function() {
  // $(".table").jScrollPane();
  setTimeout(function(){

$('.nice-scroll').height($(window).height()-100);
    <?php
    if (!preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"])) {
      echo ' $(\'.nice-scroll\').jScrollPane();';
    }
    ?>
  }, 500);
});
</script>  